/**
 * ViewTopicAction.java 1.0 2007-5-7 下午01:56:03,创建 by yangfan
 */


package org.in4j.bbs.action.topic;

import org.in4j.bbs.action.AbstractAction;
import org.in4j.bbs.model.Topic;
import org.in4j.bbs.service.TopicService;

/**
 *
 * @author yangfan
 * @version 1.0 2007-5-7 下午01:56:03,创建
 */
@SuppressWarnings("serial")
public class ViewTopicAction extends AbstractAction
{
	private int id;
	private Topic topic;
	private TopicService topicService;

	@Override
	public String execute()
	{
		this.topic = topicService.getTopicById(id);
		if(this.topic == null) return INDEX;
		return SUCCESS;
	}

	public void setId(int id)
	{
		this.id = id;
	}
	public Topic getTopic()
	{
		return topic;
	}
	public void setTopic(Topic topic)
	{
		this.topic = topic;
	}
	public void setTopicService(TopicService topicService)
	{
		this.topicService = topicService;
	}
}
